import requests from '../config/request.js'

// 朋友列表
export const friendsList = (payload) => {
	return requests.requestAll("/client/makeFriends/queryMakeFriendsList?pageSize="+payload.pageSize+'&pageNum='+payload.pageNum,'post',payload,false);
   
};

// 打招呼
export const sendMsg = (payload) => {
	return requests.requestAll("/client/makeFriends/sendMsg",'post',payload,false);
};
// 上传照片
export const savePic = (payload) => {
	return requests.requestAll("/client/makeFriends/savePic",'post',payload,false);
};

// 删除照片
export const delFile = (path) => {
	return requests.requestAll("/common/delFile?path="+path,'get');
};
// 查看照片
export const queryMakeFriendsMedia = (id) => {
	return requests.requestAll("/client/makeFriends/queryMakeFriendsMedia?customerId="+id,'get');
};
// 上传认证
export const uploadFriendsInfo = (payload) => {
	return requests.requestAll("/client/makeFriends/register",'post',payload,false);
};

export const getMakeFriendsInfo = (id) => {
	return requests.requestAll("/client/makeFriends/getMakeFriendsInfo?customerId="+id,'get');
};
// 城市列表
export const getCity = (payload) => {
	return requests.requestAll("/common/allCity",'post',payload,false);
};
// 聊天列表
export const queryChatList = (payload) => {
	return requests.requestAll("/client/makeFriends/queryChatList",'post',payload,false,false);
};


// /client/makeFriends/oneToOne 获取聊天对话
export const chatOne = (payload) => {
	return requests.requestAll("/client/makeFriends/oneToOne",'post',payload,false,false);
};
// 设置已读
export const setReadByCustomerId = (payload) => {
	
	return requests.requestAll("/client/makeFriends/setReadByCustomerId?customerId="+payload.id,'post',{},true,false);
};

// 获取朋友消息字典
export const getDict = (dictLabel) => {
	let params={
		dictType:'point_deduction',
		dictLabel:dictLabel
	}
	return requests.requestAll("/common/selectDictValue",'post',params,false);
};
export const AllStoreList = (dictLabel) => {
	return requests.requestAll("/client/store/getAllStoreList",'post',{},false);
};




// 朋友详情
// export const chatOne = (payload) => {
// 	return requests.requestAll("/client/makeFriends/oneToOne",'post',payload,false);
// };
// 新的websocket 接口******************************************
// 打招呼
export const addFriend = (data) => {
	return requests.requestAll("/client/imChatUserFriend/addFriend",'get',data);
};

// 获取聊天列表
export const getImFriend = () => {
	return requests.requestAll("/client/imChatUserFriend/getFriend",'get',{friendStatus: 1});
};
// 获取聊天信息
export const listFriendMessage = (data) => {
	return requests.requestAll("/client/imChatUserMessage/listFriendMessage",'get',data);
};

